package com.usian;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext-redis.xml")
public class String {
    @Autowired
    private RedisTemplate template;

    //存
    @Test
    public void set(){
        template.boundValueOps("zhu").set("zhuZiXian");
    }
    //取
    @Test
    public void get(){
        Object name = template.boundValueOps("zhu").get();
        System.out.println(name);
    }
    //删
    @Test
    public void  delete(){
        template.delete("zhu");
    }
}
